Fix broken editor rendering after changing font size on guest portals#185
Fix broken editor rendering after changing font size on guest portals#185
Conversation
When editor styles change, Atom notifies only editor components that are attached to the DOM at the moment of the change. Thus, if the element we are about to add had already been rendered, we will preemptively clear all its styling information to ensure it will render correctly even if some styles changed while it was not attached to the DOM.
d0d6bc6 to
89787fc
Compare
|
Does the |
|
I don't think so. Notifications of style updates come straight from I guess one way of fixing that would be to call |
Ah, except that could lead to leaks of editors that package authors forget to explicitly destroy. For a solution in core, what if we maintained a static field on the constructor with an incrementing style update counter. When an editor gets reattached, we could compare its count with the constructors and force an update if we see that we're out of date. |
Fixes #174
When editor styles change, Atom notifies only editor components that are attached to the DOM at the moment of the change. Thus, if the element we are about to add had already been rendered, we will preemptively clear all its styling information to ensure it will render correctly even if some styles changed while it was not attached to the DOM.
This is admittedly something that we should have better support for in core, but this workaround should be an okay stopgap measure.
/cc: @nathansobo @jasonrudolph